home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / Booting Gallery / Booting Gallery (source) / (Libraries) / Fluent Libraries / Utils / CriticalSection.h next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  436 b   |  31 lines  |  [TEXT/BROW]

  1. #ifndef __CriticalSection_H__
  2. #define __CriticalSection_H__
  3.  
  4. /***
  5.  *     Created by Bill Hubauer on Mon, Jan 29, 1996 @ 11:24 AM.
  6.  *
  7.  ***/
  8.  
  9. #ifndef __Semaphore__
  10. #include "Semaphore.h"
  11. #endif
  12.  
  13. class CriticalSection
  14. {
  15. public:
  16.     CriticalSection(ConstStr31Param name = NULL);
  17.     
  18.     void    Enter();
  19.     void    Exit();
  20.     
  21.     static SInt32    GetCount()        {return sCount;}
  22.     
  23. protected:
  24.     Str31        fName;
  25.     CSemaphore    fFlag;
  26.     
  27.     static         SInt32        sCount;    
  28. };
  29.  
  30. #endif
  31.